<html>
<head><meta charset="utf-8"><title>reify fn pointer for inline asm · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reify.20fn.20pointer.20for.20inline.20asm.html">reify fn pointer for inline asm</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="137125544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reify%20fn%20pointer%20for%20inline%20asm/near/137125544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikita Popov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reify.20fn.20pointer.20for.20inline.20asm.html#137125544">(Nov 03 2018 at 19:34)</a>:</h4>
<p>Anyone have some pointers on how to handle <a href="https://github.com/rust-lang/rust/issues/51130#issuecomment-435614630" target="_blank" title="https://github.com/rust-lang/rust/issues/51130#issuecomment-435614630">https://github.com/rust-lang/rust/issues/51130#issuecomment-435614630</a>? It would be possible to work around this on the codegen side, but probably the right way is to adjust type checking somehow, but I don't know how.</p>



<a name="137125697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reify%20fn%20pointer%20for%20inline%20asm/near/137125697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reify.20fn.20pointer.20for.20inline.20asm.html#137125697">(Nov 03 2018 at 19:38)</a>:</h4>
<p>Rather than typechecking, coercion needs to be applied somehow</p>



<a name="137125705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reify%20fn%20pointer%20for%20inline%20asm/near/137125705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reify.20fn.20pointer.20for.20inline.20asm.html#137125705">(Nov 03 2018 at 19:38)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> would know better, but also some other people who work in that area (<span class="user-mention" data-user-id="119009">@eddyb</span> ?)</p>



<a name="137125765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reify%20fn%20pointer%20for%20inline%20asm/near/137125765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reify.20fn.20pointer.20for.20inline.20asm.html#137125765">(Nov 03 2018 at 19:40)</a>:</h4>
<p>okay, so, the place to look for is variadics</p>



<a name="137125800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reify%20fn%20pointer%20for%20inline%20asm/near/137125800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reify.20fn.20pointer.20for.20inline.20asm.html#137125800">(Nov 03 2018 at 19:41)</a>:</h4>
<p>fixing coercion won’t fix <code>"i"(foo as *const u8)</code> not working, though.</p>



<a name="137125840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reify%20fn%20pointer%20for%20inline%20asm/near/137125840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reify.20fn.20pointer.20for.20inline.20asm.html#137125840">(Nov 03 2018 at 19:42)</a>:</h4>
<p>wait why would that not work?</p>



<a name="137125849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reify%20fn%20pointer%20for%20inline%20asm/near/137125849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reify.20fn.20pointer.20for.20inline.20asm.html#137125849">(Nov 03 2018 at 19:42)</a>:</h4>
<p>I guess LLVM does something weird sometimes</p>



<a name="137125910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reify%20fn%20pointer%20for%20inline%20asm/near/137125910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reify.20fn.20pointer.20for.20inline.20asm.html#137125910">(Nov 03 2018 at 19:44)</a>:</h4>
<p>I don’t know, the original report states that <code>"i"(foo as *const u8)</code> worked in their isolated case but not when used in an another project</p>



<a name="137125948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reify%20fn%20pointer%20for%20inline%20asm/near/137125948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reify.20fn.20pointer.20for.20inline.20asm.html#137125948">(Nov 03 2018 at 19:45)</a>:</h4>
<p>The <code>"i"</code> constraint is very constraining, I wouldn’t be surprised that there could be a ton of factor that could make it accidently not work and thus making the constraint outright unusable ever <span class="emoji emoji-1f642" title="slight smile">:slight_smile:</span></p>



<a name="137126787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/reify%20fn%20pointer%20for%20inline%20asm/near/137126787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nikita Popov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/reify.20fn.20pointer.20for.20inline.20asm.html#137126787">(Nov 03 2018 at 20:08)</a>:</h4>
<p>Ah yes, variadics look very relevant</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>